package com.xiashitech.agent.instrumentation.jetty.handler.handle.inst.common;

import io.opentelemetry.javaagent.shaded.io.opentelemetry.context.propagation.TextMapSetter;

import javax.annotation.Nullable;
import javax.servlet.http.HttpServletResponse;

public enum JettyResponseSetter implements TextMapSetter<HttpServletResponse> {
  INSTANCE;

  @Override
  public void set(@Nullable HttpServletResponse carrier, String key, String value) {
    if (carrier == null) {
      return;
    }
    carrier.setHeader(key, value);
  }
}
